/**
 * App路由模块
 */
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { GuardService } from './cores/services';

const routes: Routes = [

    // 此处设置网站首页
    { path: '', redirectTo: 'home', pathMatch: 'full' },

    // 懒加载子模块
    { path: 'admin', loadChildren: './modules/admin/admin.module#AdminModule', canActivate: [GuardService] },
    { path: 'store', loadChildren: './modules/store/store.module#StoreModule', canActivate: [GuardService] },
    { path: 'system', loadChildren: './modules/system/system.module#SystemModule', canActivate: [GuardService] },
    { path: 'basisinfo', loadChildren: './modules/basisinfo/basisinfo.module#StoreModule', canActivate: [GuardService] },
    { path: 'inventory', loadChildren: './modules/inventory/inventory.module#InventoryModule', canActivate: [GuardService] },
    { path: 'manage', loadChildren: './modules/manage/manage.module#ManageModule', canActivate: [GuardService] },
    { path: 'sales', loadChildren: './modules/sales/sales.module#SalesModule', canActivate: [GuardService] },
    { path: 'supplier', loadChildren: './modules/supplier/supplier.module#SupplierModule', canActivate: [GuardService] },
    { path: 'customer', loadChildren: './modules/customer/customer.module#CustomerModule', canActivate: [GuardService] },
    { path: 'purchase', loadChildren: './modules/purchase/purchase.module#PurchaseModule', canActivate: [GuardService] },
    { path: 'userinfo', loadChildren: './modules/userinfo/userinfo.module#UserinfoModule', canActivate: [GuardService] },
    { path: 'warehous', loadChildren: './modules/warehous/warehous.module#WarehousModule', canActivate: [GuardService] },
    { path: 'pickorder', loadChildren: './modules/pickorder/pickorder.module#PickorderModule', canActivate: [GuardService] },
    { path: 'logistics', loadChildren: './modules/logistics/logistics.module#LogisticsModule', canActivate: [GuardService] },
    { path: 'outbound', loadChildren: './modules/outbound/outbound.module#OutboundModule', canActivate: [GuardService] },
    // 最后全局匹配其他链接
      { path: 'intostorage', loadChildren: './modules/intostorage/intostorage.module#IntostorageModule', canActivate: [GuardService] },
      { path: 'notice', loadChildren: './modules/notice/notice.module#NoticeModule', canActivate: [GuardService] },
       { path: 'fullname', loadChildren: './modules/fullname/fullname.module#FullnameModule', canActivate: [GuardService] },
    // 最后全局匹配其他链接
      { path: 'outbound', loadChildren: './modules/outbound/outbound.module#OutboundModule', canActivate: [GuardService] },
    { path: 'business', loadChildren: './modules/business/business.module#BusinessModule', canActivate: [GuardService] },
    { path: 'user', loadChildren: './modules/user/user.module#UserModule', canActivate: [GuardService] },
    // 最后全局匹配其他链接
       { path: 'assets', loadChildren: './modules/assets/assets.module#AssetsModule', canActivate: [GuardService] },
       { path: 'invoice', loadChildren: './modules/invoice/invoice.module#InvoiceModule', canActivate: [GuardService] },
       { path: 'financial', loadChildren: './modules/financial/financial.module#FinancialModule', canActivate: [GuardService] },
       { path: 'cost', loadChildren: './modules/cost/cost.module#CostModule', canActivate: [GuardService] },
       { path: 'subjects', loadChildren: './modules/subjects/subjects.module#SubjectModule', canActivate: [GuardService] },
       { path: 'company', loadChildren: './modules/company/company.module#CompanyModule', canActivate: [GuardService]},
    //    { path: 'administration', loadChildren: 'app/modules/administration/administration.module#NoticeModule',
    //     canActivate: [GuardService] },
        { path: 'administration', loadChildren: './modules/administration/administration.module#NoticeModule',
        canActivate: [GuardService] },
       // 最后全局匹配其他链接
    { path: '**', redirectTo: 'error', pathMatch: 'full' }
];

@NgModule({
    imports: [
        RouterModule.forRoot(routes, {
            enableTracing: false,
            useHash: false
        })
    ],
    exports: [
        RouterModule
    ]
})
export class AppRoutingModule { }
